import Vue from 'vue'
import VueRouter from 'vue-router'

const Home = () =>import('@/views/Home.vue')
const SelectLoginMode = () =>import('@/views/login/selectLoginMode')
const Login = () =>import('@/views/login/login')
const Logup = () =>import('@/views/logup/logup')
const ProvidersLogup = () =>import('@/views/logup/providersLogup')
const EnterpriseLogup = () =>import('@/views/logup/enterpriseLogup')
const AboutPlatform = () =>import('@/views/platform/aboutPlatform')
const PlatformDynamic = () =>import('@/views/platform/platformDynamic')
//服装行业优秀方案
const Garment = () =>import('@/views/excellentScheme/garment')
const HomeAppliance = () =>import('@/views/excellentScheme/homeAppliance')
const HighEndIndustry = () =>import('@/views/excellentScheme/highEndIndustry')
const AgriculturalMachinery = () =>import('@/views/excellentScheme/agriculturalMachinery')
const ChemicalPharmacy = () =>import('@/views/excellentScheme/chemicalPharmacy')
const OtherIndustries = () =>import('@/views/excellentScheme/otherIndustries')
//解决方案详情
const SolutionDetails = () =>import('@/views/solution/solutionDetails')
//解决方案列表
const List = () =>import('@/views/solution/list')



Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: Home,
    meta:{
      title:'首页'
    }
  },
  {
    path: '/selectLoginMode',
    name: 'selectLoginMode',
    component: SelectLoginMode,
    meta:{
      title:'选择登录方式'
    }
  },
  {
    path: '/login',
    name: 'login',
    component: Login,
    meta:{
      title:'登录'
    }
  },
  {
    path: '/logup',
    name: 'logup',
    component: Logup,
    meta:{
      title:'注册'
    }
  },
  {
    path: '/providersLogup',
    name: 'providersLogup',
    component: ProvidersLogup,
    meta:{
      title:'服务商注册'
    }
  },
  {
    path: '/enterpriseLogup',
    name: 'enterpriseLogup',
    component: EnterpriseLogup,
    meta:{
      title:'企业注册'
    }
  },
  {
    path: '/platformDynamic',
    name: 'platformDynamic',
    component: PlatformDynamic,
    meta:{
      title:'关于平台'
    }
  },
  {
    path: '/aboutPlatform',
    name: 'aboutPlatform',
    component: AboutPlatform,
    meta:{
      title:'平台动态'
    }
  },
  {
    path: '/garment',
    name: 'garment',
    component: Garment,
    meta:{
      title:'服装行业优秀方案'
    }
  },
  {
    path: '/homeAppliance',
    name: 'homeAppliance',
    component: HomeAppliance,
    meta:{
      title:'家电行业优秀方案'
    }
  },
  {
    path: '/highEndIndustry',
    name: 'highEndIndustry',
    component: HighEndIndustry,
    meta:{
      title:'高端设备行业优秀方案'
    }
  },
  {
    path: '/agriculturalMachinery',
    name: 'agriculturalMachinery',
    component: AgriculturalMachinery,
    meta:{
      title:'农机行业优秀方案'
    }
  },
  {
    path: '/chemicalPharmacy',
    name: 'chemicalPharmacy',
    component: ChemicalPharmacy,
    meta:{
      title:'化学制药优秀方案'
    }
  },
  {
    path: '/otherIndustries',
    name: 'otherIndustries',
    component: OtherIndustries,
    meta:{
      title:'其他行业优秀方案'
    }
  },
  {
    path: '/solutionDetails',
    name: 'solutionDetails',
    component: SolutionDetails,
    meta:{
      title:'解决方案详情'
    }
  },
  {
    path: '/list',
    name: 'list',
    component: List,
    meta:{
      title:'解决方案列表'
    }
  },
]

const router = new VueRouter({
  routes,
  mode:'history'
})
// // 页面标题
// router.beforeEach((to,from,next)=>{
//   // 从from跳转到to
//   document.title=to.matched[0].meta.title;
//   next()
// })
export default router
